﻿CREATE  FUNCTION [dbo].[CheckQuarantineForGoods]
(
	@GoodsId int
)
RETURNS bit
AS
BEGIN
DECLARE @bitResult bit, @intCatalogId int

SELECT @intCatalogId = A.CatalogId 
FROM CA.Assortment A INNER JOIN CA.Goods G ON A.Id = G.AssortmentId
WHERE G.Id = @GoodsId

IF @intCatalogId <> 1000 SET @bitResult = 0
ELSE SET @bitResult = 1

	RETURN @bitResult
END
